import request from '@/utils/request'

export const getHospitalPage = (params) => {
  return request({
    url: '/admin/hospital/page',
    method: 'get',
    params
  })
}

export const addHospital = (data) => {
  return request({
    url: '/admin/hospital',
    method: 'post',
    data
  })
}

export const updateHospital = (data) => {
  return request({
    url: '/admin/hospital',
    method: 'put',
    data
  })
}

export const deleteHospital = (id) => {
  return request({
    url: `/admin/hospital/${id}`,
    method: 'delete'
  })
}

export const getHospitalById = (id) => {
  return request({
    url: `/admin/hospital/${id}`,
    method: 'get'
  })
}

// 获取所有医院列表的方法
export const listAllHospitals = () => {
  return request({
    url: '/admin/hospital/list',
    method: 'get'
  })
}
